package com.ruoyi.yuyuan.Controller;

import com.ruoyi.yuyuan.DTO.Result;
import com.ruoyi.yuyuan.Service.IFollowService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

//
@Slf4j
@RestController
@RequestMapping("/follow")
public class FollowController {

    @Autowired
    private IFollowService followService;

    @PostMapping("/foc/{tarId}")
    public Result follow(@PathVariable Long tarId){
        return followService.follow(tarId);
    }

    @GetMapping("/or/not/{tarId}")
    public Result isFollow(@PathVariable Long tarId){
        return followService.isFollow(tarId);
    }

    @GetMapping("/myFollows")
    public Result myFollows(){
        return followService.myFollows();
    }

    @GetMapping("/myFollowers")
    public Result myFollowers(){
        return followService.myFollowers();
    }
    @GetMapping("/tarFollows/{userId}")
    public Result tarFollows(@PathVariable Long userId){return followService.tarFollows(userId);}

    @GetMapping("/tarFollowers/{tarId}")
    public Result tarFollowers(@PathVariable Long tarId){return followService.tarFollowers(tarId);}
}
